<?php
/**
 * <i>resultMap</i>元素
 *
 * @version $Id: IResultMapElement.php 312 2008-04-23 16:29:38Z iwind $
 * @package util.sqlmap.element2
 */
class IResultMapElement extends IAbstractElement {
	/**
	 * 取得返回的class名称
	 *
	 * @return string
	 */
	public function getClassName() {
		return $this->getNode()->getAttribute("class");
	}
	
	/**
	 * 取得列的集合
	 *
	 * @return array
	 */
	public function getColumnMap() {
		$childNodes = $this->getNode()->getChildNodes();
		$map = array();
		if (count($childNodes) > 0) {
			foreach ($childNodes as $childNode) {
				if ($childNode->getType() != XML_TEXT_NODE) {
					if ($childNode->getName() == "result") {
						$column = trim($childNode->getAttribute("column"));
						$property = trim($childNode->getAttribute("property"));
						if ($column != "" && $property != "") {
							$map[$column] = $property;
						}
					}
				}
			}
		}
		return $map;
	}
}

?>